//
//  TicketOrderInfor.m
//  ImGuider
//
//  Created by 王鹏宇 on 2017/12/14.
//  Copyright © 2017年 AudioCtrip. All rights reserved.
//

#import "TicketOrderInfor.h"

@implementation TicketOrderInfor

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.TicketOrderCodeLabel.textColor = kContentColor;
    self.payTypeLabel.textColor = kThemeColor;
    self.ticketNameLabel.textColor = kSubitleColor;
    self.ticketContainLabel.textColor = kContentColor;
    self.dateLabel.textColor = kContentColor;
    self.useTimeLabel.textColor = kContentColor;
}


- (void)configDataWith:(UploadTicketOrderModel *)model {
    
    NSString * str = model.ordernumber;
    if (str.length == 0) {
        str = @"";
    }
    self.TicketOrderCodeLabel.text = [NSString stringWithFormat:MYLocalizedString(@"TICKET_ORDER", nil),str];
    if (model.subject.length == 0) {
        self.ticketNameLabel.text = @"";
    }else{
         self.ticketNameLabel.text = model.subject;
    }
    self.ticketContainLabel.text = model.orderInfo;
    
    if (model.orderdate.length > 0) {
        self.useTimeLabel.text = [NSString stringWithFormat:@"%@%@",MYLocalizedString(@"TICKET_ORDER_DATE", nil),model.orderdate];
    }
    
     NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.ordertime.doubleValue / 1000];
    self.dateLabel.text = [date stringWithFormat:@"yyyy-MM-dd HH:mm:ss"];
    switch (model.paytype.integerValue) {
        case 2:
            
            self.payTypeLabel.text = MYLocalizedString(@"PAYORDER_TYPE_ALIPAY", nil);
            break;
        case 3:
            
            self.payTypeLabel.text = MYLocalizedString(@"PAYORDER_TYPE_WX", nil);
            break;
        case 1:
            
            self.payTypeLabel.text = @"Paypal";
            break;
        default:
            break;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
